package wechat

import (
	"gitee.com/ifinder/gocomm"
	"gitee.com/ifinder/wechat-ipad-sdk-golang/wechat/friendcircle"
)





// 朋友圈图片、视频得上传，获得缩率图地址
func (this *WechatApi) FriendCircleUpload(req *friendcircle.FriendCircleUploadReq) (*friendcircle.FriendCircleUploadResp,error) {

	var resp friendcircle.FriendCircleUploadResp

	uri:=this.serviceUrl+"/718/FriendCircle/Upload"
	res,err:=gocomm.PostJSONForHeader(uri,req,map[string]string{"Content-Type":"application/x-www-form-urlencoded"})

	err=resp.FromJson(res)

	return &resp,err

}

// 发送朋友圈
func (this *WechatApi) FriendCircleMessage(req *friendcircle.FriendCircleMessageReq) (*friendcircle.FriendCircleMessageResp,error) {
	var resp friendcircle.FriendCircleMessageResp

	uri:=this.serviceUrl+"/718/FriendCircle/Messages"
	//res,err:=gocomm.PostJSON(uri,req)
	res,err:=gocomm.PostJSONForHeader(uri,req,map[string]string{"Content-Type":"application/x-www-form-urlencoded"})

	err=resp.FromJson(res)

	return &resp,err
}








